#pragma once

#include "../umlmodel_global.h"

#include "../umlcore/JsonSerializable.h"

namespace uml {

/// <summary>
/// Color
/// Color is a data type that represents a color value in the RGB format.
/// </summary>
class UMLMODEL_EXPORT Color : public JsonSerializable {

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// red getter
    /// the red component of the color in the range (0..255).
    /// </summary>
    int red() const;

    /// <summary>
    /// red setter
    /// the red component of the color in the range (0..255).
    /// </summary>
    void setRed(int value);

    /// <summary>
    /// green getter
    /// the red component of the color in the range (0..255).
    /// </summary>
    int green() const;

    /// <summary>
    /// green setter
    /// the red component of the color in the range (0..255).
    /// </summary>
    void setGreen(int value);

    /// <summary>
    /// blue getter
    /// the red component of the color in the range (0..255).
    /// </summary>
    int blue() const;

    /// <summary>
    /// blue setter
    /// the red component of the color in the range (0..255).
    /// </summary>
    void setBlue(int value);

private: // Fields
    /// <summary>
    /// red
    /// the red component of the color in the range (0..255).
    /// </summary>
    const static int red_default_;
    int red_= red_default_;

    /// <summary>
    /// green
    /// the red component of the color in the range (0..255).
    /// </summary>
    const static int green_default_;
    int green_= green_default_;

    /// <summary>
    /// blue
    /// the red component of the color in the range (0..255).
    /// </summary>
    const static int blue_default_;
    int blue_= blue_default_;

};

} // namespace uml
